<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>具名插槽的写法</title>
</head>

<body>
    <div class="app">
        <hello-vue>
            <p slot="header">我是头部</p>
            <p>样式一</p>
            <p>样式二</p>
            <p slot="footer">我是底部</p>
        </hello-vue>
        <hello-vue>
            <template slot="header">
                <p>头部区域</p>
                <p>导航区域</p>
            </template>
            <template>
                <p>样式一</p>
                <p>样式二</p>
            </template>
            <template slot="footer">
                <p>我是最底部</p>
            </template>
        </hello-vue>
    </div>

    <script src="./js/vue.js"></script>
    <script>
        Vue.component('hello-vue', {
            template: `
            <div>
                <header>
                    <slot name="header"></slot>
                </header>
                <main>
                    <slot></slot>
                </main>
                <footer>
                    <slot name="footer"></slot>
                </footer>
            </div>
            `
        })
        var xm = new Vue({
            el: '.app',
            data: {

            }
        })



    </script>

</body>

</html>